package com.baiyue.utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author 伍波
 * @date 2023/6/12 20:16
 */
public class SplitUtil {
    public static List<Integer> InterSplit(String str) {
        List<Integer> lis = new ArrayList<>();
        if (str.contains("，")) {
            String[] split = str.split("，");
            for (String num : split) {
                lis.add(Integer.parseInt(num.trim()));
            }
        } else {
            String[] split = str.split(",");
            for (String num : split) {
                lis.add(Integer.parseInt(num.trim()));
            }
        }
        return lis;
    }

    public static List<String> stringSplit(String str){
        List<String> lis = new ArrayList<>();
        String[] split;
        if(str.contains("，")){
            split = str.split("，");
        }else{
            split = str.split(",");
        }
        Collections.addAll(lis, split);
        return lis;
    }
}
